package com.glodon.zhuanli.front.servcie;

import com.glodon.framework.common.Constants;
import com.glodon.zhuanli.system.entity.SysUser;
import com.glodon.zhuanli.system.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@Service
public class ZhuanliLoginUserService {

    @Autowired
    private SysUserService sysUserService ;

    public void updateSessionUser(HttpServletRequest request ,  SysUser sysUser) {
        log.info("初始化登录用户的session信息");
        request.getSession().setAttribute(Constants.SESSION_USERID , sysUser.getId()) ;
        request.getSession().setAttribute(Constants.SESSION_USERNAME , sysUser.getName()) ;
        request.getSession().setAttribute( Constants.SESSION_USER , sysUser ) ;
    }

    public void updateSessionMenu(HttpServletRequest request ,  SysUser sysUser) {
        log.info("初始化登录用户的menu信息");
    }

}
